#pragma once

#include "IAnimation.h"

#include "../SGD Wrappers/SGD_Handle.h"

class Animation : public IAnimation
{
public:
	Animation();
	virtual ~Animation();

	virtual void Initialize(const char * filename);
	virtual void Terminate();

	virtual void Update(float _dt);
	virtual void Render(SGD::Point _position, bool _flipped, float _scale, SGD::Color _color);

	void	Pause(bool pause)	{ m_bPlaying = !pause; }
	void	Restart(bool looping, float speed);


	bool	IsPlaying(void) const	{ return m_bPlaying; }
	bool	IsFinished(void) const	{ return m_bFinished; }

protected:
	
	SGD::HTexture m_hImage	= SGD::INVALID_HANDLE;

	int   m_nCurrFrame		= 0;

	float m_fTimeWaited		= 0;
	float m_fSpeed			= 1.0f;	

	bool m_bPlaying			= false;
	bool m_bLooping			= false;
	bool m_bFinished		= false;
};

